<template>
	<view>
		<!-- 排序条件选择器 -->
		<u-picker :show="listSortPicker.show" :columns="listSortPicker.options" @confirm="listSortPicker.confirm"
			@close="listSortPicker.close" @cancel="listSortPicker.close" title="选择某属性点击确定即可" :closeOnClickOverlay=true
			keyName="label">
		</u-picker>
		<!-- 提交搜索弹窗 -->
		<u-popup :show="condition.show" :round="10" mode="bottom" :direction=0 :closeable=true
			@close="condition.close()">
			<view>
				<view style="text-align: center;margin: 10px 0 20px 0 ">
					<text style="font-size: 34rpx;font-weight: bold">
						填充筛选条件(不填的条件不参与判断)
					</text>
				</view>
				<view style="margin: 10px 10px">
					<u--form labelPosition="left" labelWidth="auto">

						<u-form-item label="银行卡号(包含) : " borderBottom>
							<u--textarea v-model="condition.data.cardNum" :clearable=true :autoHeight=true :maxlength=19
								type="number" :count=true>
							</u--textarea>
						</u-form-item>

						<u-form-item label="开户行(包含) : " borderBottom>
							<u--textarea v-model="condition.data.bankName" :clearable=true :autoHeight=true
								:maxlength=255 :count=true>
							</u--textarea>
						</u-form-item>

						<u-form-item label="持有人(包含) : " borderBottom>
							<u--textarea v-model="condition.data.cardName" :clearable=true :autoHeight=true
								:maxlength=100 :count=true>
							</u--textarea>
						</u-form-item>

						<u-form-item label="备注(包含):">
							<u--input v-model="condition.data.remark" :clearable=true border="bottom">
							</u--input>
						</u-form-item>

						<u-form-item label="创建时间范围:">
							<view style="z-index:10000">
								<uni-datetime-picker hide-second="true" type="datetimerange"
									v-model="condition.data.createTime.value" @change="condition.data.createTime.change"
									rangeSeparator="至" />
							</view>
						</u-form-item>

						<view>
							<u-row gutter="1">
								<u-col :span="6">
									<u-button type="success" text="清空" @click="condition.def()"></u-button>
								</u-col>
								<u-col :span="6">
									<u-button type="primary" text="搜索" @click="condition.search()"></u-button>
								</u-col>
							</u-row>
						</view>
					</u--form>
				</view>
			</view>
		</u-popup>
		<!--  资金信息模板  -->
		<u-modal :show="modal.byCapitalInfo.show" :title="modal.byCapitalInfo.title" :closeOnClickOverlay=true
			:showConfirmButton=false @close="modal.byCapitalInfo.close()">
			<view>
				<u--form labelPosition="left" labelWidth="auto">
					<u-form-item label="收益占比(股份) : ">
						<text style="color: #1e90ff">{{modal.byCapitalInfo.data.shares * 100 + " % "}}</text>
					</u-form-item>

					<u-form-item label="总余额 : ">
						<text style="color: #ffa502">{{modal.byCapitalInfo.data.totalBalance}}&nbsp;元</text>
					</u-form-item>

					<u-form-item label="正在提现的金额 : ">
						<text style="color: #ff4757">{{modal.byCapitalInfo.data.applyIng}}&nbsp;元</text>
					</u-form-item>

					<u-form-item label="提现成功金额 : ">
						<text style="color: #2ed573">{{modal.byCapitalInfo.data.successApply}}&nbsp;元</text>
					</u-form-item>
					<view style="display: flex;">
						<u-form-item label="不可提现金额 : ">
							<text style="color: #87847f">{{ modal.byCapitalInfo.data.noWith }}&nbsp;元</text>
						</u-form-item>
						<u-icon name="question-circle-fill" size="17" @click="modalShow=true"></u-icon>
					</view>
				</u--form>
			</view>
		</u-modal>
		
		<!-- 不可提现 -->
		<u-modal :show="modalShow" content="不可提现金额包括了土地租赁押金等其他金额" @confirm="modalShow=false"/>
			
		</u-modal>
		<!--  编辑窗  -->
		<u-popup mode="bottom" :round="10" :show="modal.byEditor.show" :showConfirmButton="false"
			:closeOnClickOverlay=true @close="modal.byEditor.close()">
			<view style="margin: 10px 0;Letter-spacing: 3px">
				<u--text type="info" bold="true" :text="modal.byEditor.title" align="center" size="20">
				</u--text>
			</view>
			<view>
				<u--text type="warning" bold="true" align="center" text="当前填写的内容,会直接影响申请提现结果,请仔细核验." />
			</view>

			<view style="margin: 10px 10px">
				<u--form labelPosition="left" labelWidth="auto">
					<u-form-item label="银行卡号 : " borderBottom>
						<u--textarea v-model="modal.byEditor.data.cardNum" :clearable=true :autoHeight=true
							:maxlength=19 type="number" :count=true>
						</u--textarea>
					</u-form-item>

					<u-form-item label="开户行 : " borderBottom>
						<u--textarea v-model="modal.byEditor.data.bankName" :clearable=true :autoHeight=true
							:maxlength=255 :count=true>
						</u--textarea>
					</u-form-item>

					<u-form-item label="持有人 : " borderBottom>
						<u--textarea v-model="modal.byEditor.data.cardName" :clearable=true :autoHeight=true
							:maxlength=100 :count=true>
						</u--textarea>
					</u-form-item>
					<u-form-item label="备注 : " borderBottom>
						<u--textarea v-model="modal.byEditor.data.remark" :clearable=true :autoHeight=true :maxlength=20
							:count=true>
						</u--textarea>
					</u-form-item>
				</u--form>
			</view>

			<view style="margin: 10px 5px 0 5px">
				<u-row gutter="2">
					<u-col :span="4">
						<u-button plain type="warning" text="返回" @click="modal.byEditor.close()">
						</u-button>
					</u-col>
					<u-col :span="4">
						<u-button plain type="primary" text="清空" @click="modal.byEditor.def()">
						</u-button>
					</u-col>
					<u-col :span="4">
						<u-button plain type="success" @click="commit" text="提交">
						</u-button>
					</u-col>
				</u-row>
			</view>
		</u-popup>
		<!--  确认删除对话窗  -->
		<u-modal :show="modal.byDelete.show" confirmText="确认删除" cancelText="取消" :showCancelButton=true
			:closeOnClickOverlay=true @close="modal.byDelete.close()" @cancel="modal.byDelete.close()"
			@confirm="modal.byDelete.confirm()">
			<view>
				<text style="Letter-spacing: 2px;color: #ff4757">
					{{modal.byDelete.title}}
				</text>
			</view>
		</u-modal>

		<!--  提现申请窗 -->
		<u-popup mode="bottom" :round="10" :show="modal.byWithdraw.show" :showConfirmButton="false"
			:closeOnClickOverlay=true @close="modal.byWithdraw.close()">
			<view style="margin: 10px 0;Letter-spacing: 3px">
				<u--text type="info" bold="true" :text="modal.byWithdraw.title" align="center" size="20">
				</u--text>
			</view>
			<view>
				<u--text type="warning" bold="true" align="center" text="请仔细核对银行卡信息以及提现金额,如有错误,请联系管理员." />
			</view>

			<view style="margin: 10px 10px">
				<u--form labelPosition="left" labelWidth="auto">
					<u-form-item label="银行卡号 : " borderBottom>
						<u--textarea v-model="modal.byWithdraw.data.cardNum" disabled :clearable=true :autoHeight=true
							:maxlength=19 type="number" :count=true>
						</u--textarea>
					</u-form-item>

					<u-form-item label="开户行 : " borderBottom>
						<u--textarea v-model="modal.byWithdraw.data.bankName" disabled :clearable=true :autoHeight=true
							:maxlength=255 :count=true>
						</u--textarea>
					</u-form-item>

					<u-form-item label="持有人 : " borderBottom>
						<u--textarea v-model="modal.byWithdraw.data.cardName" disabled :clearable=true :autoHeight=true
							:maxlength=100 :count=true>
						</u--textarea>
					</u-form-item>

					<u-form-item label="备注 : " borderBottom>
						<u--textarea v-model="modal.byWithdraw.data.remark" :clearable=true :autoHeight=true
							:maxlength=20 :count=true>
						</u--textarea>
					</u-form-item>

					<u-form-item label="提现金额 : " borderBottom>
						<u--input :placeholder="'当前最多可提现:'+maxMoney" v-model="modal.byWithdraw.data.money" type="digit"
							:maxlength="maxMoney"></u--input>
					</u-form-item>
				</u--form>
			</view>

			<view style="margin: 10px 5px 0 5px">
				<u-row gutter="2">
					<u-col :span="6">
						<u-button plain type="warning" text="返回" @click="modal.byWithdraw.close()">
						</u-button>
					</u-col>
					<u-col :span="6">
						<u-button plain type="success" @click="withdrawal()" text="提交">
						</u-button>
					</u-col>
				</u-row>
			</view>
		</u-popup>

		<!-- 按钮 -->
		<view style="margin: 20rpx 0 0 20rpx">
			<view style="display: inline-block;margin-right: 10rpx">
				<u-button shape="circle" size="medium" @click="condition.open()">
					<text style="font-size: 24rpx;
            font-weight: bold;
            color: #8c7d7d;padding: 0 20rpx">
						条件搜索
					</text>
				</u-button>
			</view>

			<view style="display: inline-block;margin-right: 10rpx">
				<u-button shape="circle" size="medium" @click="listSortPicker.open()">
					<text style="font-size: 24rpx;
            font-weight: bold;
            color: #8c7d7d;padding: 0 20rpx">
						表格排序
					</text>
				</u-button>
			</view>

			<view style="display: inline-block;margin-right: 10rpx">
				<u-button shape="circle" type="success" size="medium" @click="modal.byCapitalInfo.open()">
					<text style="font-size: 24rpx;
            font-weight: bold;
            color: #fffdfd;padding: 0 20rpx">
						资金信息
					</text>
				</u-button>
			</view>

			<view style="
          display: inline-block;
          float: right;
          margin-right: 26rpx">
				<u-button shape="circle" size="medium" type="primary" @click="modal.byEditor.open()">
					<text style="font-size: 24rpx;
            font-weight: bold;
            color: #faf9f9;padding: 0 20rpx">
						添加银行卡
					</text>
				</u-button>
			</view>

		</view>

		<view style="margin: 20rpx 30rpx">
			<uni-table border stripe :loading="table.loading" emptyText="您当前没有添加银行卡信息哦.">
				<!-- 表头行 -->
				<uni-tr>
					<uni-th align="center">
						<text class="table-th-font">创建时间</text>
					</uni-th>
					<uni-th align="center">
						<text class="table-th-font">银行卡号</text>
					</uni-th>
					<uni-th align="center">
						<text class="table-th-font">状态</text>
					</uni-th>
					<uni-th align="center">
						<text class="table-th-font">持有人</text>
					</uni-th>
					<uni-th align="center">
						<text class="table-th-font">开户行</text>
					</uni-th>
					<uni-th align="center" width="350">
						<text class="table-th-font">操作</text>
					</uni-th>
				</uni-tr>
				<uni-tr v-for="(item,index) in table.data " :key="index">
					<uni-td align="center">
						<text>{{service.style.time(item.createTime,6)}}</text>
					</uni-td>
					<uni-td align="center">
						<text>{{item.cardNum}}</text>
					</uni-td>
					<uni-td align="center">
						<rich-text :nodes="style.status(item.status)">
						</rich-text>
					</uni-td>

					<uni-td align="center">
						<text>{{item.cardName}}</text>
					</uni-td>

					<uni-td align="center">
						<text>{{item.bankName}}</text>
					</uni-td>

					<uni-td align="center">
						<view style="display: inline-block" class="operation-btn">
							<u-button size="small" type="success" plain text="详情" @click="modal.byEditor.open(item)">
							</u-button>
						</view>

						<view style="display: inline-block" class="operation-btn">
							<u-button size="small" type="primary" plain text="提现申请"
								@click="modal.byWithdraw.open(item)">
							</u-button>
						</view>

						<view style="display: inline-block" class="operation-btn">
							<u-button size="small" type="warning" text="查看提现明细" @click="gotoWithdrawal(item.cardNum)">
							</u-button>
						</view>

						<view style="display: inline-block" class="operation-btn">
							<u-button size="small" type="error" text="删除" @click="modal.byDelete.open(item)"></u-button>
						</view>
					</uni-td>
				</uni-tr>
			</uni-table>
		</view>
		<!-- 分页 -->
		<view style="text-align: center">
			<view style="display: inline-block;margin: 0 8rpx">
				<page-pagination :total="table.total" :pageSize="table.pageSize" :showAround="true" :btnText="true"
					:forceEllipses="true" @change="table.setPageNo">
				</page-pagination>
			</view>
		</view>
		<!--自己封装的提示器-->
		<popup ref="popup" />
	</view>
</template>

<script>
	import popup from "@/merchant/my/my-popup"
	import service from "@/utils/service";
	export default {
		components: {
			popup
		},
		data() {
			let _vm = this;
			return {
				modalShow:false,
				maxMoney: "",
				service: service,
				// 表格排序选择器
				listSortPicker: {
					show: false,
					// 排序字段
					sortKey: null,
					// 排序规则 1 正序 -1 倒序
					sort: -1,
					options: [
						[{
							label: '默认',
							key: null
						}, ],
						[{
								label: '从小到大',
								value: 1
							},
							{
								label: '从大到小',
								value: -1
							},
						],
					],
					// 确认回调
					confirm(v) {
						let me = _vm.listSortPicker;
						console.log("表格排序选项结果 : ", v)
						me.show = false;
						// 默认
						if (v.value[0].key === null) {
							me.sortKey = null
						} else {
							me.sortKey = v.value[0].key;
						}
						me.sort = v.value[1].value;
						this.getList();
					},
					close() {
						_vm.listSortPicker.show = false;
					},
					open() {
						_vm.listSortPicker.show = true;
					}
				},
				/* 条件筛选对象 */
				condition: {
					show: false,
					open() {
						_vm.condition.show = true;
					},
					close() {
						_vm.condition.show = false;
					},
					data: {
						maxMoney: "",
						/* 备注 */
						remark: '',
						cardNum: '',
						bankName: '',
						cardName: '',
						/* 创建时间范围 */
						createTime: {
							value: [],
							change(e) {
								console.log("选中创建时间 : ", e)
							}
						}
					},
					def() {
						_vm.condition.data.remark = ''
						_vm.condition.data.cardNum = ''
						_vm.condition.data.bankName = ''
						_vm.condition.data.cardName = ''
						_vm.condition.data.createTime.value = []
						_vm.condition.search();
					},
					search() {
						console.log("点击搜索 条件 : ", _vm.condition.data)
						_vm.condition.close();
						_vm.getList();
					}
				},
				table: {
					loading: true,
					total: 0,
					pageSize: 10,
					pageNo: 1,
					data: [],
					setPageNo(v) {
						_vm.table.pageNo = v
						_vm.getList();
					},
				},

				/* 模态窗对象 */
				modal: {
					// 资金信息
					byCapitalInfo: {
						show: false,
						title: '资金信息',
						data: {
							/* 收益占比 */
							shares: 0.00,
							/* 总余额 */
							totalBalance: 0.00,
							/* 正在提现金额 */
							applyIng: 0.00,
							/* 提现成功的金额 */
							successApply: 0.00,
						},
						open() {
							_vm.modal.byCapitalInfo.show = true
						},
						close() {
							_vm.modal.byCapitalInfo.show = false
						}
					},
					// 编辑窗
					byEditor: {
						show: false,
						title: '编辑银行卡信息',
						target: 'add',
						data: {
							id: '',
							/* 银行卡号 */
							cardNum: '',
							/* 持有人 */
							cardName: '',
							/* 开户行 */
							bankName: '',
							/* 备注 */
							remark: '',
						},
						open(item = undefined) {
							if (!service.check.isNull(item)) {
								/* 如果是上次是添加则清空 */
								if (_vm.modal.byEditor.target !== 'update') {
									_vm.modal.byEditor.target = 'update'
									_vm.modal.byEditor.def();
								}
								_vm.modal.byEditor.data = item
							} else {
								if (_vm.modal.byEditor.target !== 'add') {
									_vm.modal.byEditor.target = 'add'
									_vm.modal.byEditor.def();
								}
							}
							_vm.modal.byEditor.show = true
						},
						def() {
							_vm.modal.byEditor.data = {
								id: '',
								cardNum: '',
								cardName: '',
								bankName: '',
								remark: '',
							}
						},
						close() {
							_vm.modal.byEditor.show = false
						}
					},
					// 提现
					byWithdraw: {
						show: false,
						title: '提现申请',
						data: {
							cardId: '',
							cardNum: '',
							bankName: '',
							cardName: '',
							money: '',
							remark: ''
						},
						checkData() {
							let data = _vm.modal.byWithdraw.data;
							if (service.check.isNull(data.cardId)) {
								uni.showToast({
									title: '银行卡数据丢失,请尝试重新上传',
									icon: 'none'
								})
								return true;
							}

							if (!service.check.isNumber(data.money)) {
								uni.showToast({
									title: '请输入正确的提现金额数值',
									icon: 'none'
								})
								return true;
							} else {
								if (service.check.isDecimalOutBounds(data, 2)) {
									uni.showToast({
										title: '金额数值只精确到分(只支持两位小数)',
										icon: 'none'
									})
									return true;
								}
							}
							console.log("提现申请校验参数通过")
							return false;
						},
						open(item = undefined) {
							console.log("item : ", item)
							_vm.modal.byWithdraw.show = true
							let data = _vm.modal.byWithdraw.data;
							data.cardId = item.id;
							data.money = item.money;
							data.remark = item.remark;
							data.bankName = item.bankName;
							data.cardNum = item.cardNum;
							data.cardName = item.cardName;
						},
						def() {
							_vm.modal.byWithdraw.data = {
								cardId: '',
								cardNum: '',
								bankName: '',
								cardName: '',
								money: '',
								remark: ''
							}
						},
						close() {
							_vm.modal.byWithdraw.show = false
						}
					},
					// 删除确认
					byDelete: {
						show: false,
						title: '确认删除该银行卡信息吗?',
						data: null,
						open(item = undefined) {
							_vm.modal.byDelete.data = item;
							_vm.modal.byDelete.show = true;
						},
						confirm() {
							_vm.deleteItem(_vm.modal.byDelete.data)
						},
						close() {
							_vm.modal.byDelete.show = false;
						}
					}
				},
				/* 样式对象 */
				style: {
					status(v) {
						return v === 0 ?
							"<span style='color: #7bed9f'>正常</span>" :
							"<span style='color: #ff6b81'>不可用</span>"
					}
				},
				/* 加载对象 */
				loading: {
					// 进度
					plan: 0,
					// 阈值
					threshold: 0,
					step() {
						if (++this.plan >= this.threshold) {
							uni.hideLoading();
						}
					}
				},

			};
		},
		methods: {
			/* 获取商家资本信息 */
			getCapitalInfo() {
				let _t = this;
				this.$axios({
					url: 'merchant/merchantBankCard/withdrawalDetail',
					method: "post",
					header: {
						"Authorization": this.token,
						"Content-type": this.contentType,
						"type": "merchantsToken"
					},
				}).then(res => {
					console.log(' merchant/merchantBankCard/withdrawalDetail :', res)
					if (res.code === 0) {
						_t.modal.byCapitalInfo.data = res.result;
						console.log("_t.modal.byCapitalInfo.data: ", _t.modal.byCapitalInfo.data);
						_t.maxMoney = _t.modal.byCapitalInfo.data.totalBalance - _t.modal.byCapitalInfo.data.noWith
						console.log("_t.maxMoney: ", _t.maxMoney);
					}
				}).finally(() => {
					_t.loading.step();
				})
			},

			/* 获取银行卡列表 */
			getList() {
				let _t = this;
				let data = {};
				data.pageSize = this.table.pageSize;
				data.pageNo = this.table.pageNo;
				// 如果有排序字段添加排序字段
				if (this.listSortPicker.sortKey !== null) {
					data.sortKey = this.listSortPicker.sortKey;
				}
				if (this.listSortPicker.sort !== null) {
					data.sort = this.listSortPicker.sort;
				}
				// 追加条件筛选对象
				let condition = _t.condition.data;
				if (!service.check.isNull(condition.remark)) {
					data.remark = condition.remark;
				}
				if (!service.check.isNull(condition.cardNum)) {
					data.cardNum = condition.cardNum;
				}
				if (!service.check.isNull(condition.bankName)) {
					data.bankName = condition.bankName;
				}
				if (!service.check.isNull(condition.cardName)) {
					data.cardName = condition.cardName;
				}
				if (condition.createTime.value.length !== 0) {
					data.createTimeScope = JSON.stringify(condition.createTime.value);
				}
				this.$axios({
					url: 'merchant/merchantBankCard/list',
					method: "post",
					data: data,
					header: {
						"Authorization": this.token,
						"Content-type": this.contentType,
						"type": "merchantsToken"
					},
				}).then(res => {
					console.log(" merchant/merchantBankCard/list :  ", res)
					if (res.code === 0) {
						_t.table.data = res.result.list;
						_t.table.pageNo = res.result.pageNo;
						_t.table.total = res.result.total;
					} else {
						_t.$refs.popup.error("获取银行卡列表失败, 请重试 : " + res.message)
					}
				}).finally(() => {
					_t.table.loading = false;
					_t.loading.step();
				})
			},

			/* 校验参数 */
			checkParam() {
				let _t = this;
				let data = _t.modal.byEditor.data;
				let target = _t.modal.byEditor.target;
				let check = service.check;

				if (target === 'update' && check.isNull(data.id)) {
					uni.showToast({
						title: '提交的数据丢失, 请重试',
						icon: 'none'
					})
					return true;
				}

				if (!check.isBankNumber(data.cardNum)) {
					uni.showToast({
						title: '请填写正确的银行卡号码',
						icon: 'none'
					})
					return true
				}

				if (check.isNull(data.cardName)) {
					uni.showToast({
						title: '请填写持有人信息',
						icon: 'none'
					})
					return true
				}

				if (check.isNull(data.bankName)) {
					uni.showToast({
						title: '请填写开户行信息',
						icon: 'none'
					})
					return true
				}


				console.log("参数校验通过")
				return false;
			},

			/* 提现 */
			withdrawal() {
				let _t = this;
				if (_t.modal.byWithdraw.checkData()) {
					return;
				}
				if (_t.modal.byWithdraw.data.money > _t.maxMoney) {
					uni.showToast({
						icon: "none",
						title: "当前最多可提现金额为" + _t.maxMoney
					})
					return;
				}
				let temp = _t.modal.byWithdraw.data;
				let data = {
					cardId: temp.cardId,
					money: temp.money,
				}
				if (!service.check.isNull(temp.remark)) {
					data.remark = temp.remark;
				}
				uni.showLoading({
					title: '提交中....',
					mask: true
				})
				this.$axios({
					url: 'merchant/merchantApply/apply',
					method: "post",
					data: data,
					header: {
						"Authorization": this.token,
						"Content-type": this.contentType,
						"type": "merchantsToken"
					},
				}).then(res => {
					console.log(" merchant/merchantApply/apply :  ", res)
					if (res.code === 0) {
						_t.$refs.popup.success("申请提现成功")
					} else {
						_t.$refs.popup.error("申请提现失败 : " + res.result);
					}
				}).finally(() => {
					_t.modal.byWithdraw.close();
					uni.hideLoading();
				})
			},

			/* 跳转到提现明细页面 */
			gotoWithdrawal(cardNum) {
				uni.navigateTo({
					url: '../withdrawalDetails/list?cardNum=' + cardNum,
				})
			},
			deleteItem(item) {
				if (service.check.isNull(item)) {
					this.modal.byDelete.close();
					this.$refs.popup.error("删除申请失败 : 不存在的数据")
					return;
				}
				let _t = this;
				uni.showLoading({
					title: '提交中....',
					mask: true
				})
				this.$axios({
					url: "merchant/merchantBankCard/delete",
					method: "post",
					data: {
						id: item.id
					},
					header: {
						"Authorization": this.token,
						"Content-type": this.contentType,
						"type": "merchantsToken"
					},
				}).then(res => {
					console.log(" merchant/merchantBankCard/delete :", res)
					if (res.code === 0) {
						_t.getList();
						_t.$refs.popup.success("删除成功");
					} else {
						_t.$refs.popup.error("删除失败 : " + res.result)
					}
				}).finally(() => {
					_t.modal.byDelete.close();
					uni.hideLoading();
				})
			},
			commit() {
				if (this.checkParam()) {
					return
				}
				let _t = this;
				let check = service.check;
				let temp = _t.modal.byEditor.data;
				let data = {};
				if (!check.isNull(temp.id)) {
					data.id = temp.id;
				}
				data.cardNum = temp.cardNum
				data.cardName = temp.cardName
				data.bankName = temp.bankName
				data.remark = temp.remark
				uni.showLoading({
					title: '提交中....',
					mask: true
				})
				this.$axios({
					url: 'merchant/merchantBankCard/addOrUpdate',
					method: 'post',
					data: data,
					header: {
						"Authorization": this.token,
						"Content-type": this.contentType,
						"type": "merchantsToken"
					},
				}).then(res => {
					console.log(' merchant/merchantBankCard/addOrUpdate :  ', res)
					if (res.code === 0) {
						_t.getList();
						_t.$refs.popup.success("提交成功");
					} else {
						_t.$refs.popup.error("提交失败 : " + res.result)
					}
				}).finally(() => {
					_t.modal.byEditor.close();
					_t.modal.byEditor.def();
					uni.hideLoading();
				})
			},

		},
		onLoad() {
			// 获取图像地址前缀
			this.imgApi = this.$reqConfig.URLIMAGE
			// 获取请求头类型
			this.contentType = this.$reqConfig.CONTENTTYPE + ";+charset=UTF-8"
			// 获取token
			this.token = uni.getStorageSync("merchantsToken").token

			// 资金 + 列表
			this.loading.threshold = 2;
			uni.showLoading({
				title: '加载信息中.....',
				mask: true,
			})
		},
		onShow() {

			/* 获取商家资金信息 */
			this.getCapitalInfo();

			/* 获取列表信息 */
			this.getList();
		}
	}
</script>

<style lang="scss">
	.table-th-font {
		font-size: 30rpx;
		color: #1c6f5c;
	}

	.operation-btn {
		margin: 2rpx 4rpx;
	}

	/*表头样式*/
	.uni-table-th {
		background-color: #eff8ff;
		border: 1px #EBEEF5 solid;
	}

	/*内容样式*/
	.uni-table-td {
		border: 1px #EBEEF5 solid;
	}

	/*表单 label*/
	.u-form-item__body__left__content__label.data-v-067e4733 {
		font-size: 30rpx;
		font-weight: bold;
	}
</style>
